﻿/******************************************************************
** 文件名:T106_GoodClassStockProperty.cs
** Copyright (c) 
** 创建人:佟礼
** 日 期:2012-07-10 17:45:45
** 描 述:
********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Enter.Entity;
using Enter.DataProxy.Mail;
using Enter.DataProxy.Mail.Base;
using Enter.Factory;
namespace Enter.BizLogic.Base
{
    /// <summary>
    /// T106_GoodClassStockProperty
    /// </summary>
    public class T106_GoodClassStockPropertyBLLBase
    {
        private const string TableName = "T106_GoodClassStockProperty";
        public static readonly IT106_GoodClassStockPropertyManager Manager = DataFactory.Create_T106_GoodClassStockProperty();
        #region 保存记录
        /// <summary>
        /// 保存记录
        /// </summary>
        /// <returns></returns>
        public bool Save(T106_GoodClassStockPropertyEntity Entity)
        {
            if (Entity.PID > 0)
            {
                return Manager.Update(Entity) > 0;
            }
            else
            {
                return Manager.Insert(Entity) > 0;
            }
        }
        #endregion

        #region 删除数据
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <returns></returns>
        public bool Delete(int id)
        {
            return Manager.Delete(id) > 0;
        }
        #endregion


        #region 根据PID获取一个对象
        public T106_GoodClassStockPropertyEntity GetObjectByPID(int PID)
        {
            return Manager.GetObjectByPID(PID);
        }
        #endregion


        public DataTable GetTable()
        {
            return Manager.ShowTable();
        }

        public DataTable GetTable(string WhereStr, int pageSize, int currentPageIndex, out int totalPages, out int totalCount)
        {
            PageEntity entity = new PageEntity();
            entity.Where = WhereStr;
            entity.PageSize = pageSize;
            entity.CurrentPageIndex = currentPageIndex;
            return Manager.ShowTable(entity, out  totalPages, out  totalCount);
        }

        public List<T106_GoodClassStockPropertyEntity> ShowList()
        {
            return (List<T106_GoodClassStockPropertyEntity>)Manager.ShowList();
        }

    }
}
